export default {
    // 计算总价
    totalPrice(state) {
        return state.books.reduce((prev, current) => {
            return prev + (current.isSelected ? current.price*current.num : 0)
        }, 0)
    },
    isSelectAll(state) {
        return state.books.filter(item => item.isSelected).length == state.books.length
    }
}